package cn.edu.buu.hospital.mapper;
import cn.edu.buu.hospital.entity.Appointment;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface AppointmentMapper {
    // 添加预约
    int insert(Appointment appointment);
    // 查询所有预约
    List<Appointment> selectAll();
    // 根据ID查询预约
    Appointment selectById(Long appointment);
    // 根据排班ID查询预约
    List<Appointment> selectByVisitId(Long visited);
    // 添加条件查询方法，使用@Param注解明确参数名
    List<Appointment> selectByCondition(@Param("condition") Appointment condition, @Param("appointmentDate") String appointmentDate);
    // 更新预约信息
    int update(Appointment appointment);
    // 根据ID删除预约
    int deleteById(Long appointment);
    // 更新预约状态
    int updateStatus(@Param("appointmentId") Long appointmentId, @Param("status") Integer status);
    long countTodayAppointments();
    // 根据用户ID查询预约记录
    List<Appointment> selectByUserId(@Param("userid") Long userId);
}